<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<html>
<head>

<title>库房分配</title>
<style type="text/css">
td {
	font-size: 14px;
	text-align: center;
}

input {
	text-align: center;
}

table {
	text-align: center;
}

#sousuo1 {
	background-image: img/search-icon.png;
	position: relative;
	top: -18px;
	left: -15px
}

#xinxi {
	display: none;
	background-color: powderblue;
	position: absolute;
	left: 700PX;
	top: 180px;
}
</style>
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/index.css" />

<script src="js/bootstrap3.7.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.min.js"></script>
<!-- 动态菜单JS -->
<script type="text/javascript" src="js/menu.js"></script>
</head>

<body>

	<div class="container">
		<div class="cont-top">
			<div class="companyname">ERP管理系统</div>
			<div class="cont-top-middle">
				<ul>
					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon.png">
							</div>
							<div class="top-txt">购物单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

					<li><a href="#">
							<div class="top-middle">
								<img src="img/icon1.png">
							</div>
							<div class="top-txt">收款单</div>
					</a></li>

				</ul>
			</div>
			<div class="cont-top-rg">
				<ul class="advanced-menu">
					<li>
						<div class="top-search">
							<div class="t-s-l">
								<span class="left-line"></span> <input type="text" value="搜库存"
									class="search-type" disabled> <span
									class="triangle-bottom"></span>
							</div>
							<div class="t-s-l">



								<form action="BuyServlet?act=sousuo" method="post">
									<input type="text" placeholder="请输入商品编码或名称" name="sou"
										class="search-dt"> <span class="right-line"></span> <span
										class="right-icon"> <span class="right-line"> <input
											type="submit" value="搜索" id="sousuo1" /></span>
								</form>





							</div>
						</div>
					</li>
					<li class="default" style="position: relative;"><span
						class="user"><img src="img/user.png"></span> <a
						onclick="denglu()" class="special">${user.name}<i><img
								src="img/xl.png"></i></a>
						<div class="drop-down-wrap"
							style="width: 180px; left: 15px; display: none;">
							<div class="drop-down">
								<span class="triangle-border"></span> <span class="triangle-bg"></span>
								<ul class="del-ul">
									<li><a href="#" class="hot">首耀照明</a></li>
									<li><a href="#">小丫头</a></li>
									<li><a href="#">操作日志</a></li>
								</ul>
							</div>
						</div></li>
				</ul>
				<ul class="advanced-menu">
					<li><a href="#"><img src="img/top-icon1.png"></a></li>
					<li><a href="#"><img src="img/top-icon2.png"></a></li>
					<li><a href="#"><img src="img/top-icon3.png"></a></li>
					<li><a href="#"><img src="img/top-icon4.png"></a></li>
					<li><a href="#"><img src="img/top-icon5.png"></a></li>
				</ul>
			</div>
		</div>
		<div class="left-menu" style="height: 949px;">
			<div class="menu-list">
				<ul>
					<li class="menu-list-01">

						<p class="fumenu">库房管理</p> <img class="xiala" src="img/xiala.png" />

						<div class="list-p">
							<a href="BuyServlet?act=kufang">
								<p class="zcd" id="zcd5">入库单</p>
							</a> <a href="BuyServlet?act=weixiu_show"><p class="zcd"
									id="zcd6">维修单</p></a>

						</div>
					</li>

					<li class="menu-list-02"><a href="ckgl.html">
							<p class="fumenu">产品管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd5">产品库存</p>
							<p class="zcd" id="zcd6">产品成本</p>
							<p class="zcd" id="zcd7">产品属性管理</p>
						</div></li>

					<li class="menu-list-01"><a href="dd-ddgl.html">
							<p class="fumenu">订单管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd8">下单账户</p>
							<p class="zcd" id="zcd9">所属员工</p>
							<p class="zcd" id="zcd10">订单成本</p>
							<p class="zcd" id="zcd1">订单成本费用</p>
							<p class="zcd" id="zcd12">订单总支付金额</p>
							<p class="zcd" id="zcd3">订单商品</p>
							<p class="zcd" id="zcd14">手动增加订单</p>
						</div></li>

					<li class="menu-list-02"><a href="cj-ckd.html">
							<p class="fumenu">财务管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd15">记录出款和入款</p>
							<p class="zcd" id="zcd16">计算一段时间的利润</p>
						</div></li>

					<li class="menu-list-01"><a href="kh-khgl.html">
							<p class="fumenu">客户管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd17">客户基本信息</p>
							<p class="zcd" id="zcd18">客户VIP登记管理</p>
							<p class="zcd" id="zcd19">客户信息管理</p>
							<p class="zcd" id="zcd20">客户订单管理</p>
							<p class="zcd" id="zcd21">转移客户</p>
						</div></li>

					<li class="menu-list-02"><a href="yg-jbxx.html">
							<p class="fumenu">员工管理</p> <img class="xiala" src="img/xiala.png" />
					</a>
						<div class="list-p">
							<p class="zcd" id="zcd22">员工基本信息</p>
							<p class="zcd" id="zcd23">员工权限</p>
							<p class="zcd" id="zcd24">开通新客户</p>
							<p class="zcd" id="zcd25">销售额管理</p>
						</div></li>
				</ul>
			</div>
		</div>

		<div class="right-menu">
			<div class="main-hd">
				<div class="page-teb">
					<div class="l-tab-links">
						<ul style="left: 0;">
							<li class="l-select"><a href="index.jsp"
								style="padding: 0px 25px;">首页</a></li>
							<li class="l-select"><a href="#">库房分配</a> <span
								class="close"></span></li>
						</ul>
					</div>

					<div class="l-tab-content" style="background: #fff;">
						<div class="tab-content-item">
							<div class="home">
								<!--库房分配   开始-->
								<div class="kufang-box">
									<div class="kufang">
										<div class="kf-fl">
											<ul>
												<li>价格方式：<span>库存成本价</span></li>
												<li style="display: none;">仓库：<span>天津站</span></li>
												<li style="display: none;">时间：<span>2016-08-15至2017-08-25</span></li>
											</ul>
										</div>

										<div class="kf-rg">
											<ul>
												<!-- <li><span><input type="checkbox"
														onclick="baofei()">选择报废</span></li> -->
												<li><span><input type="checkbox" value="true">显示停用商品</span>
												</li>
												<li><span>过滤 <select class="kf-in" id="change"
														onchange="change(this.value)">
															<option>选择过滤</option>
															<option>显示全部</option>
															<option>维修申请</option>
															<option>已领用</option>
															<option>未领用</option>
															<option>已报废</option>
													</select>
												</span></li>
											</ul>
										</div>
									</div>
								</div>

								<div class="kf-tab">
									<div class="headerbar-kf">
										<table class="headerbar" border="0" cellpadding="0"
											cellspacing="1">
										</table>
									</div>


									<div class="" tabindex="0">
										<table border="0" cellpadding="0" cellspacing="1"
											class="fkbody-rows" style="width: 100%;">
											<tbody>



												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;" id="anhao"
														name=${anhao}  >ID</div>
												</td>

												<td class="caption cao-l">

													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产编码</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产名称</div>
												</td>

												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产购置时间</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">资产状态</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">使用人</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">损坏情况</div>
												</td>
												<td class="caption cao-l">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">维修费用</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">维修时间</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">设备替换</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1">
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;">申请</div>
												</td>
												<td class="caption cao-l" colspan="1" rowspan="1" id="yin" >
													<div class="caotion-kf-txt"
														style="overflow: hidden; text-align: center;"  >资产归还</div>
												</td>

												</tr>
											</tbody>

											<tbody>
												<form action="BuyServlet?act=shenqing_tijiao" method="post" id="huan" >

													<c:set var="a" value="${yeshu}"></c:set>
													<c:set var="b" value="1"></c:set>
													<c:forEach var="i" begin="0" end="${size}">

														<c:set var="p" value="${weixiulist[i]}"></c:set>
														<tr class="fkbody-s" _rowindex="0">

															<td class="bodyrow-list" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1" id=" ">${i+1}</div>
															</td>
															<td class="bodyrow-list" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1" id="bianma${i}"
																	style="width: 100px; height: 20px;">${p.zichanbianma}</div>
															</td>
															<td class="bodyrow-list" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100px; height: 20px;">${p.zichanming}</div>
															</td>


															<td class="bodyrow-list" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100px; height: 20px;">${p.zichangouzhishijian}</div>
															</td>
															<td class="bodyrow-list" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1"
																	style="width: 100px; height: 20px;" id="zhuangtai${i}">${p.zhuangtai}</div>
															</td>

															<td class="bodyrow-list" style="overflow: hidden;" align="center">
																
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100px; height: 20px;">${p.shiyongren}</div>
															</td>
															<td class="bodyrow-list" style="overflow: hidden;" align="center">
																
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100px; height: 20px;">${p.sunhuaiqingk}</div>
															</td>

															<td class="bodyrow-list" style="overflow: hidden;" align="center">
																
																<div class="caotion-kf-txt1" id=" " style="width: 100px; height: 20px;">
																	
																	<input type="text" id="feiyong${i}" value='${p.weixiufeiyong}'  onclick="erea()" />
																	
																		
																</div>
															</td>     


															<td class="bodyrow-list" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100px; height: 20px;">
																	<input type="text" id="shijian${i}"  value=
																		'${p.weixiushijian}'  
																		 />
																</div>
															</td>
															<td class="bodyrow-list" style="overflow: hidden;"
																align="center">
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100px; height: 20px;">
																	<input type="text" id="tihuan${i}"   value=
																		'${p.shebeitihuan}'  
																		onclick="erea()" />
																</div>
															</td>
															<td class="bodyrow-list"
																style="overflow: hidden; width:150px" align="center">
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100%; height: 20px; text-align: center;">
																	<input type="submit" name="en" id="${i}" value="同意"
																		onclick="tong1(this.id)"
																		style="width: 50px; height: 20px;" />&nbsp;&nbsp;&nbsp;&nbsp;
																	<input type="submit" name="en" id="to${i}" value="驳回"
																		onclick="bohui1(this.id)"
																		style="width: 50px; height: 20px;" />&nbsp;&nbsp;&nbsp;&nbsp;
																	
																</div>
															</td>
															<td class="bodyrow-list"  id="yi"
																style="overflow: hidden; width: 80px" align="center">
																<div class="caotion-kf-txt1" id=" "
																	style="width: 100%; height: 20px; text-align: center;">
																	<input type="submit" name="en" id="gui${i}"
																		value="归还" onclick="guihuan(this.id)"
																		style="width: 70px; height: 20px;" />
																</div>
															</td>

														</tr>


														<c:set var="a" value="${a+1}"></c:set>
														<c:set var="b" value="${b+1}"></c:set>
													</c:forEach>
												</form>
											</tbody>




										</table>

									</div>








									</tbody>
								</div>


								<div class="lu">
									共<i>${a-1}</i>条记录


								</div>
								<div class="tab-btn">
									<div class="bt-f">
										<ul>
											<li><a href="BuyServlet?act=daochu" class="special"><button
														class="button-li">选择导出</button></a></li>
<!-- 											<li><a href="BuyServlet?act=weixiu_guihuan" -->
<!-- 												class="special"><button class="button-li">维修归还</button></a> -->
<!-- 											</li> -->
											<li>
												<button class="button-li">价格方式</button>
											</li>
										</ul>
									</div>
									<div class="bt-rg">
										<ul>
											<li><button>打印</button></li>
											<li><button>退出</button></li>
										</ul>
									</div>
								</div>
								<!--库房分配   结束-->
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>
<script>







	a = 3;
	document.getElementById("yin").style.display = "none";
	
	
	for (var i = 0; i < a; i++) {
		var id = document.getElementById("gui" + i)
		if (id != null) {

			a++;
			
			document.getElementById("gui" + i).style.display = "none";
			
			var zhuagntai = document.getElementById("zhuangtai" + i).innerHTML
			if (zhuagntai =="已同意") {
				document.getElementById("gui" + i).style.display = "block";
				
				document.getElementById("yin").style.display = "block";
				
			}
		}
	}
	
	
	function  guihuan(id){
		
		document.getElementById("huan").action="BuyServlet?act=weixiu_guihuanqueren"
				
			var a = id.indexOf("i");
		var b = id.substring(a + 1, id.length);

		var bl=confirm("确认归还吗?")
		if(bl==true){
	var deng= document.getElementById("bianma"+b).innerHTML
	
	document.getElementById("gui"+b).name="guibianma";
	document.getElementById("gui"+b).value=deng;
	var feiyong= document.getElementById("feiyong"+b).value
				document.getElementById("feiyong"+b).name="feiyong";

	var shijian= document.getElementById("shijian"+b).value
				document.getElementById("shijian"+b).name="shijian";
	var tihuan= document.getElementById("tihuan"+b).value
				document.getElementById("tihuan"+b).name="tihuan";
		
		}else{
			window.location.href = 'BuyServlet?act=weixiu_show'
		}
		
		
	}
	
	function denglu(){
		 
		 var bl = confirm('确认重新登陆吗')
			
			if(bl==true){
				window.location.href="login.jsp";
			}
		 
		 
	 }
		
	
	function tong1(id) {
		var bl = confirm("确定同意申请吗?")
		if (bl == true) {
			var deng = document.getElementById("bianma" + id).innerHTML

			document.getElementById(id).name = "tong";
			document.getElementById(id).value = deng;
		}
	}

	function bohui1(id) {
		var bl = confirm("确定驳回申请吗?")
		if (bl == true) {
			var a = id.indexOf("o");
			var b = id.substring(a + 1, id.length);

			var deng = document.getElementById("bianma" + b).innerHTML

			document.getElementById(id).name = "bohui";
			document.getElementById(id).value = deng;
		}
	}
	function shanga(id) {

		var deng = document.getElementById("yeshu1").innerHTML;

		document.getElementById(id).name = "shang";
		document.getElementById(id).value = deng;

	}

	function xia1(id) {

		var deng = document.getElementById("yeshu1").innerHTML;

		document.getElementById(id).name = "xia";
		document.getElementById(id).value = deng;

	}

	function fenye(a) {

		document.getElementById(a).name = "fe";

	}

	function baofei() {

		window.location.href = "BuyServlet?act=baofei";

	}

	function queren() {

		var bl = confirm('确认提交吗')

		if (bl == true) {
			document.getElementById("xinxi").submit()
		}

	}
	function erea(id) {

		var neirong = document.getElementById(id).value
		if (neirong == "未领用") {

			var name = document.getElementById("ming" + id).innerHTML

			document.getElementById("ming").value = name

			var name1 = document.getElementById("zichan" + id).value
			document.getElementById("zichan").value = name1

			document.getElementById("xinxi").style.display = "block"
		} else if (neirong == "已领用") {
			var bl = confirm('确认取消领用吗')
			if (bl == true) {

				var name1 = document.getElementById("zichan" + id).value
				document.getElementById("zichan").value = name1
				document.getElementById("xinxi").submit()

			}
		} else if (neirong == "已报废") {
			alert("已报废不可修改")

		}
	}

	function yincang() {
		document.getElementById("xinxi").style.display = "none"

	}

	function change(value) { //筛选 领用或未领用
		var a = document.getElementById("change").value
		if (a == "未领用") {
			document.getElementById("change").value = "未领用";
			window.location.href = "BuyServlet?act=weilingyong";

		}
		if (a == "已领用") {
			document.getElementById("change").value = "已领用";
			window.location.href = "BuyServlet?act=yilingyong";

		}
		if (a == "显示全部") {

			window.location.href = "BuyServlet?act=kufang";

		}
		if (a == "已报废") {

			window.location.href = "BuyServlet?act=baofei_cha";

		}
		if (a == "维修申请") {

			window.location.href = "BuyServlet?act=weixiu_shenqingshow";

		}
	}
</script>

</html>
